'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const sys_config = app.model.define('sys_config', {
    configId: {
      type: INTEGER(20),
      comment: "参数主键",
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field:"config_id"
    },
    configName: {
      type: STRING(100),
      comment: "参数名称",
      defaultValue: "",
      field:"config_name"
    },
    configKey: {
      type: STRING(100),
      comment: "参数键名",
      defaultValue: "",
      field:"config_key"
    },
    configValue: {
      type: STRING(500),
      comment: "参数键值",
      defaultValue: "",
      field:"config_value"
    },
    configType: {
      type: STRING(1),
      comment: "系统内置（Y是 N否）",
      defaultValue: "N",
      field:"config_type"
    },
    createBy: {
      type: STRING(64),
      comment: "创建者",
      defaultValue: "",
      field:"create_by"
    },
    updateBy: {
      type: STRING(64),
      comment: "更新者",
      defaultValue: "",
      field:"update_by"
    },
    remark: {
      type: STRING(500),
      comment: "备注",
      defaultValue: ""
    },
    createTime:{
      type:DATE,
      field:"created_at"
    }
  }, {
    freezeTableName: true
  });

  return sys_config;
};